home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / a-g / ami2d / rexx / ami2d.rexx < prev    next >
OS/2 REXX Batch file  |  1978-11-24  |  2KB  |  66 lines

  1. /* Ami2d startup script for interactive use */
  2. options results
  3.  
  4. if ~show('l', "rexxarplib.library") then do
  5.     check = addlib('rexxarplib.library',0,-30,0)   
  6. end
  7.  
  8. call pragma('stack',50000)
  9. address command
  10. 'assign ami2d: /ami2d'
  11.  
  12. /* For WShell (cnc: device) uncomment the next line 
  13.    and the line near the bottom */
  14.  
  15. /* 'dhopts menu ami2d:rexx/ami2d-menus name ami2d' */
  16.  
  17. if ~show('ports', "AMI2D") then do
  18.     'run ami2d:bin/ami2d ami2d:rexx/init'
  19.     do while ~show('ports', "AMI2D")
  20.     end
  21. end
  22.  
  23. address ami2d 'open(-52,-50)'
  24.  
  25. call 'ami2d:rexx/rexxbar'
  26. call 'ami2d:rexx/rexxcon'
  27.  
  28. do forever
  29.     address rxc_ami2d 'read'
  30.     comm = result
  31.     if comm = 'stop' then leave
  32.     if index(comm,'!cd') = 1 then do
  33.         if length(pragma('directory',substr(comm,5))) = 0 then iterate
  34.     end
  35.     n = index(comm,"!")
  36.     if n = 1 then do
  37.         if length(comm) = 1 then do
  38.             comm = GetFile(,,,,"select macro","AMI2D","PATGAD",,,,"#?.rexx")
  39.             if length(comm) = 0 then iterate
  40.             comm '>pipe:ami2d'
  41.         end
  42.         else substr(comm,2) '>pipe:ami2d'
  43.         call open('ami2d','pipe:ami2d','R')
  44.         do while ~eof('ami2d')
  45.             line = readln('ami2d')
  46.             if length(line) ~= 0 then address rxc_ami2d 'write("'line'")'
  47.         end
  48.         call close('ami2d')
  49.     end
  50.     else do
  51.         address ami2d comm
  52.         if rc > 0 then address ami2d 'why'
  53.         if length(result) > 0 then address rxc_ami2d 'write("'result'")'
  54.     end
  55. end
  56. call postmsg
  57. address rxb_ami2d 'stop'
  58. address rxc_ami2d 'stop'
  59. if show('ports', "NLN2D") then address nln2d 'stop'
  60. address ami2d 'stop'
  61.  
  62. /* For WShell (cnc: device) uncomment the next line */
  63.  
  64. /* 'dhopts delete ami2d' */
  65. exit
  66.